<template>
  <page-header-wrapper>
    <tabList :tabList="tabList">
      <div class="searchBox">
        <div class="select">
          <span>商户：</span>
          <a-input placeholder="请输入商户名" v-model="queryParam.order_no">
            <a-icon slot="suffix" type="search" />
          </a-input>
        </div>
        <div class="select">
          <span>商品名称：</span>
          <a-input placeholder="请输入商品名称" v-model="queryParam.order_no">
            <a-icon slot="suffix" type="search" />
          </a-input>
        </div>
        <a-button type="primary" @click="getList">查询</a-button>
      </div>
    </tabList>
    <a-card :bordered="false" class="card_style_re" style="margin-top: 16px">
      <a-table
        :rowKey="
          (r, i) => {
            return r.id
          }
        "
        :pagination="{
          total: this.totalCount,
          showSizeChanger: false,
          onChange: this.tablePageChange,
        }"
        :columns="columns"
        :data-source="list"
        :scroll="{ x: 'max-content' }"
      >
        <div slot="name" slot-scope="text, record">
          <div class="name">
            <div class="pic">
              <img :src="record.goods_list[0].pic" alt="" />
            </div>
            <div class="info">
              <span>{{ record.goods_list[0].goods_name }}</span>
              <span>规格：{{ record.goods_list[0] | sku }}</span>
            </div>
          </div>
        </div>
        <span slot="mobile" slot-scope="scope"> {{ scope.name }} / {{ scope.mobile }} </span>
        <span slot="audit_time" slot-scope="text">
          {{ text > 0 ? $moment(text * 1000).format('YYYY-MM-DD HH:mm:ss') : '-' }}
        </span>
        <div slot="buy" slot-scope="scope">
          <div>{{ scope.nickname }}</div>
          <div>{{ scope.created_at > 0 ? $moment(scope.created_at * 1000).format('YYYY-MM-DD HH:mm:ss') : '-' }}</div>
        </div>
      </a-table>
    </a-card>
  </page-header-wrapper>
</template>

<script>
import { setDel } from '@/api/share'
import tabList from '@/views/saas/components/tabList.vue'
import { cyyUploadImg } from '@/components/CyyUi'
const columns = [
  {
    title: 'ID',
    dataIndex: 'id',
  },
  {
    title: '商品名称',
    scopedSlots: {
      customRender: 'name',
    },
    width: 200,
  },
  {
    title: '售价',
    dataIndex: 'address',
    sorter: (a, b) => a.created_at - b.created_at,
  },
  {
    title: '规格',
    dataIndex: 'created_at',
  },
  {
    title: '状态',
    dataIndex: 'audit_time',
  },
]

export default {
  components: {
    tabList,
    cyyUploadImg,
  },
  data() {
    return {
      tabList:[{
          key:'saasBusinessList',
          name:'商户列表'
      },{
          key:'saasBusinessBand',
          name:'绑定商品记录'
      },{
          key:'saasBusinessBalance',
          name:'余额变动记录'
      },{
          key:'saasBusinessRecharge',
          name:'充值记录'
      },{
          key:'saasBusinessTrans',
          name:'转单记录'
      },{
          key:'saasBusinessPurchase',
          name:'采购记录'
      }],
      // 搜索参数
      queryParam: {
        order_no: null,
        name: null,
        pageNo: 1,
        pageSize: 10,
      },
      selectedRowKeys: [],
      columns,
      list: [],
    }
  },
  created() {},
  methods: {
    // 关闭弹窗的回调
    closeModal() {},
    // 分页请求
    tablePageChange(e) {
      this.queryParam.page = e
      this.getList()
    },
    // 获取数据
    getList() {},
  },
}
</script>
<style lang="less" scoped>
.searchBox {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  /deep/ .ant-input-affix-wrapper {
    width: 220px;
    margin-right: 20px;
  }
  .select {
    margin-top: 11px;
    display: flex;
    align-items: center;
    margin-right: 15px;
  }
  .ant-btn {
    margin-top: 11px;
  }
}
.tip {
  line-height: normal;
  margin-bottom: 0;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.45);
}
</style>
